package com.example.springmvc;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping("/springmvc")
public class HelloController {

  @ModelAttribute
  public void model(Model model) {
    model.addAttribute("message", "Hello Spring MVC");
  }

  @RequestMapping("/hello")
  public String handleRequest() {
    return "index";
  }

}
